/**
 * Created by Administrator on 2017/05/19 0019.
 */
import React,{Component} from 'react';
import { timestampFormat } from '../../public/index'
import backGroundPic from '../../img/gift/lds9zhe.jpg'

export default class GiftItem extends Component{

    componentWillMount(){
    }

    render(){
        return(
            <div className="itemGift" onClick={this.props.onClick} >
                {
                    this.props.giftList.centerModel.title.indexOf('雷迪森')>-1&&
                    <div  style={{'background': 'url('+backGroundPic+') no-repeat',
                        'backgroundSize':'100% 100%' ,
                        'height':'100%',
                    }}></div>
                }

                <div className="itemGiftDetail">
                    {
                        this.props.giftList.centerModel.title.indexOf('雷迪森')==-1&&
                            <div>
                                <p>
                                    <div>
                                        <span className="status">{this.props.giftList.isUse===0?"未使用":(this.props.giftList.isUse===1?"已使用":"其他")}</span>
                                        {/*<img role="presentation" src={this.props.giftList.centerModel.maxPic} className=""/>*/}

                                        <span className="giftName">{this.props.giftList.centerModel.title.split(' ')[0]}</span>
                                        <span className="giftName">{this.props.giftList.centerModel.title.split(' ')[1]?
                                        ""+this.props.giftList.centerModel.title.split(' ')[1]+'':''}</span>

                                        <span className="giftTime">{timestampFormat(this.props.giftList.centerModel.startTime,2)+"-"+timestampFormat(this.props.giftList.centerModel.endTime,2)}</span>
                                    </div>
                                </p>



                                <div>

                                    <div className="code"><span>券号:</span>{this.props.giftList.code}</div>

                                    {/* <div className="shopName"><span>商户:</span>{this.props.giftList.centerModel.title}</div>*/}

                                </div>
                            </div>
                    }

                </div>
            </div>

        )
    }
}